package view;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JLabel;

import view.utils.MenuView;
import control.menu.MenuControl;

public class PainelPrincipal extends JFrame implements View {
	

	private static final long serialVersionUID = 1L;

	private MenuView menuBar;
	
	private JLabel labelImagem;

	private MenuControl controle;

	public PainelPrincipal(ActionListener controle) {
		this.controle = (MenuControl) controle;
		init();
		setupPanel();
		layoutComponents();
		setup();
	}

	private void setup() {
		setTitle("SisTGen");
		setJMenuBar(menuBar);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		Dimension screenTela = Toolkit.getDefaultToolkit().getScreenSize();
		this.setBounds(0, 0, screenTela.width, screenTela.height - 40);
		this.setResizable(false);
	}

	private void setupPanel() {

	}

	private void layoutComponents() {
		getContentPane().add(labelImagem);
	}

	private void init() {

		menuBar = new MenuView(new MenuControl());
		
		labelImagem = new JLabel();
				//JLabel(new ImageIcon(getClass()
				//.getResource("images/h.jpg")),
				//SwingConstants.CENTER);
		//labelImagem.setVisible(true);

	}

	public void close() {
		dispose();
	}

	public void exibir() {
		setVisible(true);
	}

	@Override
	public void fechar() {
		dispose();
	}


}
